
CC= ppu-gcc 
CFLAGS = -O3 -m64 -unroll-loops -lm -lspe2 -Wall -I/opt/cell/sdk/usr/include
#-m64

CINCS      = cmatrixprod.h cmatrixprod_ref.h
CLIBS      = -lspe2

SPU_CC=spu-gcc
SPU_CINCS  = cmatrixprod.h
SPU_CLIBS  =
SPU_CFLAGS =   -Wall #-lspe2 -I/opt/cell/sdk/usr/include

OBJ=testcgemm.o cmatrixprod.o cmatrixprod_ref.o


all : testcgemm cmatrixprod_spe

testcgemm : $(OBJ)
	$(CC) $(OBJ) $(CFLAGS) -o $@ #-lmisc

cmatrixprod_spe : cmatrixprod_spe.o
	$(SPU_CC) $(SPU_CFLAGS) $(SPU_CINCS) $(SPU_CLIBS) $^ -o $@

cmatrixprod_spe.o : cmatrixprod_spe.c
	$(SPU_CC) $(SPU_CFLAGS) $(SPU_CINCS) $(SPU_CLIBS) $^ -c

clean :
	rm -f *.o testcgemm

vclean :
	make clean
	rm -f  *~
